package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.MesWarehousePositionMapper;
import com.ruoyi.order.domain.MesWarehousePosition;
import com.ruoyi.order.service.IMesWarehousePositionService;

/**
 * 库位信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-15
 */
@Service
public class MesWarehousePositionServiceImpl implements IMesWarehousePositionService 
{
    @Autowired
    private MesWarehousePositionMapper mesWarehousePositionMapper;

    /**
     * 查询库位信息
     * 
     * @param id 库位信息主键
     * @return 库位信息
     */
    @Override
    public MesWarehousePosition selectMesWarehousePositionById(Long id)
    {
        return mesWarehousePositionMapper.selectMesWarehousePositionById(id);
    }
    /**
     * 查询库位信息
     * 
     * @param code 库位信息编码
     * @return 库位信息
     */
    @Override
    public MesWarehousePosition selectMesWarehousePositionByCode(String code)
    {
        return mesWarehousePositionMapper.selectMesWarehousePositionByCode(code);
    }

    /**
     * 查询库位信息列表
     * 
     * @param mesWarehousePosition 库位信息
     * @return 库位信息
     */
    @Override
    public List<MesWarehousePosition> selectMesWarehousePositionList(MesWarehousePosition mesWarehousePosition)
    {
        return mesWarehousePositionMapper.selectMesWarehousePositionList(mesWarehousePosition);
    }

    /**
     * 新增库位信息
     * 
     * @param mesWarehousePosition 库位信息
     * @return 结果
     */
    @Override
    public int insertMesWarehousePosition(MesWarehousePosition mesWarehousePosition)
    {
        mesWarehousePosition.setCreateTime(DateUtils.getNowDate());
        return mesWarehousePositionMapper.insertMesWarehousePosition(mesWarehousePosition);
    }

    /**
     * 修改库位信息
     * 
     * @param mesWarehousePosition 库位信息
     * @return 结果
     */
    @Override
    public int updateMesWarehousePosition(MesWarehousePosition mesWarehousePosition)
    {
        mesWarehousePosition.setUpdateTime(DateUtils.getNowDate());
        return mesWarehousePositionMapper.updateMesWarehousePosition(mesWarehousePosition);
    }

    /**
     * 批量删除库位信息
     * 
     * @param ids 需要删除的库位信息主键
     * @return 结果
     */
    @Override
    public int deleteMesWarehousePositionByIds(Long[] ids)
    {
        return mesWarehousePositionMapper.deleteMesWarehousePositionByIds(ids);
    }

    /**
     * 删除库位信息信息
     * 
     * @param id 库位信息主键
     * @return 结果
     */
    @Override
    public int deleteMesWarehousePositionById(Long id)
    {
        return mesWarehousePositionMapper.deleteMesWarehousePositionById(id);
    }
}
